SUBDIRS = src
PYFILES = $(wildcard *.py)
PKGNAME = jdesktop
VERSION = 0.1
PYTHON = python
SRCDIR = src
MISCDIR=misc
PIXDIR = pixmaps

subdirs:
	for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1 ; done

clean:
	for d in $(SUBDIRS); do make -C $$d clean ; done

install:
	mkdir -p $(DESTDIR)/usr/share/jdesktop
	mkdir -p $(DESTDIR)/usr/share/pixmaps/jdesktop
	mkdir -p $(DESTDIR)/usr/share/applications
	mkdir -p $(DESTDIR)/usr/bin
	install -m644 COPYING $(DESTDIR)/usr/share/jdesktop/.
	install -m644 $(PIXDIR)/*.png $(DESTDIR)/usr/share/pixmaps/jdesktop/.
	install -m644 $(PIXDIR)/*.ttf $(DESTDIR)/usr/share/pixmaps/jdesktop/.
	install -m644 $(PIXDIR)/*.jpg $(DESTDIR)/usr/share/pixmaps/jdesktop/.	
	
	install -m755 $(MISCDIR)/jdesktop $(DESTDIR)/usr/bin/.
	chmod +x $(DESTDIR)/usr/bin/jdesktop
	install -m644 $(MISCDIR)/jdesktop.desktop $(DESTDIR)/usr/share/applications/.
	install -m644 $(MISCDIR)/jdesktop-applet.desktop $(DESTDIR)/usr/share/gnome/autostart/.
	for d in $(SUBDIRS); do make DESTDIR=$(DESTDIR) -C $$d install; [ $$? = 0 ] || exit 1; done

uninstall:
	rm -r /usr/share/jdesktop
	rm -r /usr/share/pixmaps/jdesktop
	rm    /usr/share/applications/jdesktop.desktop
	rm    /usr/share/gnome/autostart/jdesktop-applet.desktop
	rm    //usr/bin/jdesktop
	make clean
